FROM centos:7
MAINTAINER xxx@qq.com

# 系统镜像源
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 安装相关依赖
RUN yum -y install net-tools kde-l10n-Chinese freetype fontconfig
# 编译生成语言库
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
# 设置语言默认值为中文，时区改为东八区
RUN echo 'LANG="zh_CN.UTF-8"' > /etc/locale.conf
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8

# JDK环境变量
ENV JAVA_HOME /opt/jdk/graalvm-jdk-21.0.5+9.1
ENV PATH $PATH:$JAVA_HOME/bin
# 拷贝并且解压JDK
ADD graalvm-jdk-21_linux-x64_bin.tar.gz /opt/jdk/
# 验证JDK环境
RUN java -version

WORKDIR /

# 暴露端口product环境
EXPOSE 8080

ADD target/example-bootstrap.jar ./

#测试环境
CMD java  -Djava.security.egd=file:/dev/./urandom  -Duser.timezone=GMT+8 -jar example-bootstrap.jar  --spring.profiles.active=product
